I have seen this char at many places in the code base , Its something to deal with signed and unsigned char ?
Can some plese tell what is this exactly used for
I have seen this char at many places in the code base , Its something to deal with signed and unsigned char ?
Can some plese tell what is this exactly used for
What code-base is that. I haven't found it particularly often in my 20+ years as a programmer. It is the same as 0xFF (or -1 in signed chars). It is, as far as I know, an "unprintable" character in ANSI 8-bit character sets, so it may be used for special purposes by some people since it's unlikely to appear in texts - particularly where you can't use NUL (another unprintable character) since it's the "end of string marker". But that's speculatin. Perhpas I would be able to give a better answer if you point us to the code?
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
code snippet
AddData("@PJL SET JOBATTR=\"JobAcct7=\377Internal Page\"\r\n");
In this case, it's probably some "special meaning to the PDL", but again, this is a guess - it's not an area I'm particularly familiar with - it could simply be to "make sure this lists last in an alphabetical sort - as 0377 is the highest "ascii" code you could come up with.
I expect you can use this in XML - I don't see why not.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
i was going through google looking at varios code snippets , and in all these this char was use to do some signed unsigned operations .
\377 is octal for:
- 255 decimal
- FF hexadecimal
- 1111 1111 binary
It is unprintable and is most likely being used as a control character of some sort.
Todd
Thanxs a lot everyone ,1 more question ,
If i have a nonnegativeinteger in XML Schema , and i try to set it with a negative integer , will the system crash ??
Are you asking what \377 actually means, or are you asking whether a code of \377 is valid when occurring inside a PJL environment attribute? As far as C is concerned, there is nothing special about the value \377. I have no idea what restrictions XML may have. But as far as PJL, this is valid PJL.
BTW, this is the first time somebody has ever asked a question that relates to my day job![]()
Probably not, but you will possibly get an error attempting to read the data back in, or it will do "unpredictable" things [such as not treating the number as a negative, but as a very large positive number].
It should be fairly easy to hack up a quick test to figure out...
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.